package com.jiadakeji.ppm.api.common;

import java.io.Serializable;

public class JsonResult<T> implements Serializable{
	private static final long serialVersionUID = 5976579887981314692L;
	
	private int code = 0;
	private String message = "请求成功";
	private T data;
	
	public JsonResult() {
	}

	public JsonResult(int code,String message){
		this.code=code;
		this.message=message;
	}
	
	public JsonResult(T data){
		this.data = data;
	}
	
	public JsonResult(int code,String message,T data){
		this.code = code;
		this.message = message;
		this.data = data;
	}
	
	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public JsonResult<T> setCodeAndMessage(int code ,String message){
		this.code = code;
		this.message = message;
		return this;
	}
	
}
